package com.woniuxy.admin.controller;



import com.woniuxy.core.annotation.Permission;
import com.woniuxy.core.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.woniuxy.admin.service.AdminAccountRoleService;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ...
 * @since 2024年05月22日
 */
@RestController
@RequestMapping("/adminAccountRole")
@Api(tags="管理员角色")
public class AdminAccountRoleController {

    @Resource
    private AdminAccountRoleService adminAccountRoleService;

    /**
     * 绑定管理员账号角色
     * @param accountId 账号Id
     * @param roleId 角色Id
     * @return
     */
    @GetMapping("/bindingAdminRole")
    @ApiOperation("绑定管理员账号角色")
    @ApiImplicitParams({
            @ApiImplicitParam(name="accountId",value = "账号ID"),
            @ApiImplicitParam(name="roleId",value = "角色ID")
    })
    @Permission(roles = {"超级管理员"})
    public Result bindingAdminRole(Integer accountId, Integer roleId){
        adminAccountRoleService.bindingAdminRole(accountId,roleId);
        return Result.success("角色绑定账号成功",null);
    }


}

